<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CPAN::Meta::Spec - specification for CPAN distribution metadata - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/CPAN::Meta::Spec">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./CPAN::Meta::Spec.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/CPAN::Meta::Spec">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/CPAN::Meta::Spec">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/CPAN::Meta::Spec">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/CPAN::Meta::Spec">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/CPAN::Meta::Spec">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/CPAN::Meta::Spec">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/CPAN::Meta::Spec">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/CPAN::Meta::Spec">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/CPAN::Meta::Spec">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/CPAN::Meta::Spec">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/CPAN::Meta::Spec">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/CPAN::Meta::Spec">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/CPAN::Meta::Spec">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/CPAN::Meta::Spec">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/CPAN::Meta::Spec">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/CPAN::Meta::Spec">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/CPAN::Meta::Spec">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/CPAN::Meta::Spec">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/CPAN::Meta::Spec">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/CPAN::Meta::Spec">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/CPAN::Meta::Spec">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/CPAN::Meta::Spec">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/CPAN::Meta::Spec">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/CPAN::Meta::Spec">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/CPAN::Meta::Spec">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/CPAN::Meta::Spec">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/CPAN::Meta::Spec">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/CPAN::Meta::Spec">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/CPAN::Meta::Spec">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/CPAN::Meta::Spec">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/CPAN::Meta::Spec">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/CPAN::Meta::Spec">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/CPAN::Meta::Spec">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/CPAN::Meta::Spec">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/CPAN::Meta::Spec">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/CPAN::Meta::Spec">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/CPAN::Meta::Spec">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/CPAN::Meta::Spec">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/CPAN::Meta::Spec">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/CPAN::Meta::Spec">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/CPAN::Meta::Spec">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/CPAN::Meta::Spec">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/CPAN::Meta::Spec">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/CPAN::Meta::Spec">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/CPAN::Meta::Spec">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/CPAN::Meta::Spec">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/CPAN::Meta::Spec">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/CPAN::Meta::Spec">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/CPAN::Meta::Spec">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/CPAN::Meta::Spec">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/CPAN::Meta::Spec">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/CPAN::Meta::Spec">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/CPAN::Meta::Spec">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/CPAN::Meta::Spec">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/CPAN::Meta::Spec">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/CPAN::Meta::Spec">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/CPAN::Meta::Spec">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/CPAN::Meta::Spec">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/CPAN::Meta::Spec">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/CPAN::Meta::Spec">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/CPAN::Meta::Spec">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/CPAN::Meta::Spec">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/CPAN::Meta::Spec">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/CPAN::Meta::Spec">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/CPAN::Meta::Spec">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/CPAN::Meta::Spec">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/CPAN::Meta::Spec">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/CPAN::Meta::Spec">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/CPAN::Meta::Spec">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/CPAN::Meta::Spec">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/CPAN::Meta::Spec">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/CPAN::Meta::Spec">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/CPAN::Meta::Spec">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/CPAN::Meta::Spec">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/CPAN::Meta::Spec">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/CPAN::Meta::Spec">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/CPAN::Meta::Spec">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/CPAN::Meta::Spec">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/CPAN::Meta::Spec">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/CPAN::Meta::Spec">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./CPAN::Meta::Spec.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/CPAN::Meta::Spec">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/CPAN::Meta::Spec">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/CPAN::Meta::Spec">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/CPAN::Meta::Spec">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/CPAN::Meta::Spec">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/CPAN::Meta::Spec">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/CPAN::Meta::Spec">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/CPAN::Meta::Spec">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/CPAN::Meta::Spec">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/CPAN::Meta::Spec">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/CPAN::Meta::Spec">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/CPAN::Meta::Spec">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/CPAN::Meta::Spec">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/CPAN::Meta::Spec">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/CPAN::Meta::Spec">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/CPAN::Meta::Spec">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/CPAN::Meta::Spec">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/CPAN::Meta::Spec">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/CPAN::Meta::Spec">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/CPAN::Meta::Spec">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/CPAN::Meta::Spec">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/CPAN::Meta::Spec">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/CPAN::Meta::Spec">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/CPAN::Meta::Spec">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/CPAN::Meta::Spec">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/CPAN::Meta::Spec">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/CPAN::Meta::Spec">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/CPAN::Meta::Spec">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/CPAN::Meta::Spec">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/CPAN::Meta::Spec">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/CPAN::Meta::Spec">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/CPAN::Meta::Spec">5.35.1</a>
          <a class="dropdown-item active" href="./CPAN::Meta::Spec.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./CPAN::Meta::Spec.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="./CPAN::Meta::Spec.html">CPAN::Meta::Spec</a>
          <div id="more">
            (<a href="./CPAN::Meta::Spec.txt">source</a>,
            <a href="https://metacpan.org/pod/CPAN::Meta::Spec">CPAN</a>)
          </div>
            <div id="moduleversion">version 2.150010</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#VERSION">VERSION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#DESCRIPTION">DESCRIPTION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#TERMINOLOGY">TERMINOLOGY</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#DATA-TYPES">DATA TYPES</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Boolean">Boolean</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#String">String</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#List">List</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Map">Map</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#License-String">License String</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#URL">URL</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Version">Version</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Version-Range">Version Range</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#STRUCTURE">STRUCTURE</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#REQUIRED-FIELDS">REQUIRED FIELDS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#abstract">abstract</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#author">author</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#dynamic_config">dynamic_config</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#generated_by">generated_by</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#license">license</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#meta-spec">meta-spec</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#name">name</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#release_status">release_status</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#version1">version</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#OPTIONAL-FIELDS">OPTIONAL FIELDS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#description">description</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#keywords">keywords</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#no_index">no_index</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#optional_features">optional_features</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#prereqs1">prereqs</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#provides">provides</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#resources">resources</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#DEPRECATED-FIELDS">DEPRECATED FIELDS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#build_requires">build_requires</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#configure_requires">configure_requires</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#conflicts">conflicts</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#distribution_type">distribution_type</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#license_uri">license_uri</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#private">private</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#recommends">recommends</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#requires">requires</a>
              </li>
          </ul>

              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#VERSION-NUMBERS">VERSION NUMBERS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Version-Formats">Version Formats</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Version-Ranges">Version Ranges</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#PREREQUISITES">PREREQUISITES</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Prereq-Spec">Prereq Spec</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Phases">Phases</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Relationships">Relationships</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Merging-and-Resolving-Prerequisites">Merging and Resolving Prerequisites</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#SERIALIZATION">SERIALIZATION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#NOTES-FOR-IMPLEMENTORS">NOTES FOR IMPLEMENTORS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Extracting-Version-Numbers-from-Perl-Modules">Extracting Version Numbers from Perl Modules</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Comparing-Version-Numbers">Comparing Version Numbers</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Prerequisites-for-dynamically-configured-distributions">Prerequisites for dynamically configured distributions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#Indexing-distributions-a-la-PAUSE">Indexing distributions a la PAUSE</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#SEE-ALSO">SEE ALSO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#HISTORY">HISTORY</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#AUTHORS">AUTHORS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./CPAN::Meta::Spec.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="./CPAN::Meta::Spec.html#NAME">#</a>NAME</h1>

<p>CPAN::Meta::Spec - specification for CPAN distribution metadata</p>

<h1 id="VERSION"><a class="permalink" href="./CPAN::Meta::Spec.html#VERSION">#</a>VERSION</h1>

<p>version 2.150010</p>

<h1 id="SYNOPSIS"><a class="permalink" href="./CPAN::Meta::Spec.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<pre><code>my $distmeta = {
  name =&gt; &#39;Module-Build&#39;,
  abstract =&gt; &#39;Build and install Perl modules&#39;,
  description =&gt;  &quot;Module::Build is a system for &quot;
    . &quot;building, testing, and installing Perl modules. &quot;
    . &quot;It is meant to ... blah blah blah ...&quot;,
  version  =&gt; &#39;0.36&#39;,
  release_status =&gt; &#39;stable&#39;,
  author   =&gt; [
    &#39;Ken Williams &lt;kwilliams@cpan.org&gt;&#39;,
    &#39;Module-Build List &lt;module-build@perl.org&gt;&#39;, # additional contact
  ],
  license  =&gt; [ &#39;perl_5&#39; ],
  prereqs =&gt; {
    runtime =&gt; {
      requires =&gt; {
        &#39;perl&#39;   =&gt; &#39;5.006&#39;,
        &#39;ExtUtils::Install&#39; =&gt; &#39;0&#39;,
        &#39;File::Basename&#39; =&gt; &#39;0&#39;,
        &#39;File::Compare&#39;  =&gt; &#39;0&#39;,
        &#39;IO::File&#39;   =&gt; &#39;0&#39;,
      },
      recommends =&gt; {
        &#39;Archive::Tar&#39; =&gt; &#39;1.00&#39;,
        &#39;ExtUtils::Install&#39; =&gt; &#39;0.3&#39;,
        &#39;ExtUtils::ParseXS&#39; =&gt; &#39;2.02&#39;,
      },
    },
    build =&gt; {
      requires =&gt; {
        &#39;Test::More&#39; =&gt; &#39;0&#39;,
      },
    }
  },
  resources =&gt; {
    license =&gt; [&#39;http://dev.perl.org/licenses/&#39;],
  },
  optional_features =&gt; {
    domination =&gt; {
      description =&gt; &#39;Take over the world&#39;,
      prereqs     =&gt; {
        develop =&gt; { requires =&gt; { &#39;Genius::Evil&#39;     =&gt; &#39;1.234&#39; } },
        runtime =&gt; { requires =&gt; { &#39;Machine::Weather&#39; =&gt; &#39;2.0&#39;   } },
      },
    },
  },
  dynamic_config =&gt; 1,
  keywords =&gt; [ qw/ toolchain cpan dual-life / ],
  &#39;meta-spec&#39; =&gt; {
    version =&gt; &#39;2&#39;,
    url     =&gt; &#39;https://metacpan.org/pod/CPAN::Meta::Spec&#39;,
  },
  generated_by =&gt; &#39;Module::Build version 0.36&#39;,
};</code></pre>

<h1 id="DESCRIPTION"><a class="permalink" href="./CPAN::Meta::Spec.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>This document describes version 2 of the CPAN distribution metadata specification, also known as the &quot;CPAN Meta Spec&quot;.</p>

<p>Revisions of this specification for typo corrections and prose clarifications may be issued as CPAN::Meta::Spec 2.<i>x</i>. These revisions will never change semantics or add or remove specified behavior.</p>

<p>Distribution metadata describe important properties of Perl distributions. Distribution building tools like Module::Build, Module::Install, ExtUtils::MakeMaker or Dist::Zilla should create a metadata file in accordance with this specification and include it with the distribution for use by automated tools that index, examine, package or install Perl distributions.</p>

<h1 id="TERMINOLOGY"><a class="permalink" href="./CPAN::Meta::Spec.html#TERMINOLOGY">#</a>TERMINOLOGY</h1>

<dl>

<dt id="distribution"><a class="permalink" href="./CPAN::Meta::Spec.html#distribution">#</a>distribution</dt>
<dd>

<p>This is the primary object described by the metadata. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed together for other developers to use. Examples of distributions are <code>Class-Container</code>, <code>libwww-perl</code>, or <code>DBI</code>.</p>

</dd>
<dt id="module"><a class="permalink" href="./CPAN::Meta::Spec.html#module">#</a>module</dt>
<dd>

<p>This refers to a reusable library of code contained in a single file. Modules usually contain one or more packages and are often referred to by the name of a primary package that can be mapped to the file name. For example, one might refer to <code>File::Spec</code> instead of <i>File/Spec.pm</i></p>

</dd>
<dt id="package"><a class="permalink" href="./CPAN::Meta::Spec.html#package">#</a>package</dt>
<dd>

<p>This refers to a namespace declared with the Perl <code>package</code> statement. In Perl, packages often have a version number property given by the <code>$VERSION</code> variable in the namespace.</p>

</dd>
<dt id="consumer"><a class="permalink" href="./CPAN::Meta::Spec.html#consumer">#</a>consumer</dt>
<dd>

<p>This refers to code that reads a metadata file, deserializes it into a data structure in memory, or interprets a data structure of metadata elements.</p>

</dd>
<dt id="producer"><a class="permalink" href="./CPAN::Meta::Spec.html#producer">#</a>producer</dt>
<dd>

<p>This refers to code that constructs a metadata data structure, serializes into a bytestream and/or writes it to disk.</p>

</dd>
<dt id="must,-should,-may,-etc."><a class="permalink" href="./CPAN::Meta::Spec.html#must,-should,-may,-etc.">#</a><a id="must"></a><a id="must-should-may-etc"></a>must, should, may, etc.</dt>
<dd>

<p>These terms are interpreted as described in IETF RFC 2119.</p>

</dd>
</dl>

<h1 id="DATA-TYPES"><a class="permalink" href="./CPAN::Meta::Spec.html#DATA-TYPES">#</a><a id="DATA"></a>DATA TYPES</h1>

<p>Fields in the <a href="./CPAN::Meta::Spec.html#STRUCTURE">&quot;STRUCTURE&quot;</a> section describe data elements, each of which has an associated data type as described herein. There are four primitive types: Boolean, String, List and Map. Other types are subtypes of primitives and define compound data structures or define constraints on the values of a data element.</p>

<h2 id="Boolean"><a class="permalink" href="./CPAN::Meta::Spec.html#Boolean">#</a>Boolean</h2>

<p>A <i>Boolean</i> is used to provide a true or false value. It <b>must</b> be represented as a defined value that is either &quot;1&quot; or &quot;0&quot; or stringifies to those values.</p>

<h2 id="String"><a class="permalink" href="./CPAN::Meta::Spec.html#String">#</a>String</h2>

<p>A <i>String</i> is data element containing a non-zero length sequence of Unicode characters, such as an ordinary Perl scalar that is not a reference.</p>

<h2 id="List"><a class="permalink" href="./CPAN::Meta::Spec.html#List">#</a>List</h2>

<p>A <i>List</i> is an ordered collection of zero or more data elements. Elements of a List may be of mixed types.</p>

<p>Producers <b>must</b> represent List elements using a data structure which unambiguously indicates that multiple values are possible, such as a reference to a Perl array (an &quot;arrayref&quot;).</p>

<p>Consumers expecting a List <b>must</b> consider a String as equivalent to a List of length 1.</p>

<h2 id="Map"><a class="permalink" href="./CPAN::Meta::Spec.html#Map">#</a>Map</h2>

<p>A <i>Map</i> is an unordered collection of zero or more data elements (&quot;values&quot;), indexed by associated String elements (&quot;keys&quot;). The Map&#39;s value elements may be of mixed types.</p>

<h2 id="License-String"><a class="permalink" href="./CPAN::Meta::Spec.html#License-String">#</a><a id="License"></a>License String</h2>

<p>A <i>License String</i> is a subtype of String with a restricted set of values. Valid values are described in detail in the description of the <a href="./CPAN::Meta::Spec.html#license">&quot;license&quot;</a> field.</p>

<h2 id="URL"><a class="permalink" href="./CPAN::Meta::Spec.html#URL">#</a>URL</h2>

<p><i>URL</i> is a subtype of String containing a Uniform Resource Locator or Identifier. [ This type is called URL and not URI for historical reasons. ]</p>

<h2 id="Version"><a class="permalink" href="./CPAN::Meta::Spec.html#Version">#</a>Version</h2>

<p>A <i>Version</i> is a subtype of String containing a value that describes the version number of packages or distributions. Restrictions on format are described in detail in the <a href="./CPAN::Meta::Spec.html#Version-Formats">&quot;Version Formats&quot;</a> section.</p>

<h2 id="Version-Range"><a class="permalink" href="./CPAN::Meta::Spec.html#Version-Range">#</a><a id="Version1"></a>Version Range</h2>

<p>The <i>Version Range</i> type is a subtype of String. It describes a range of Versions that may be present or installed to fulfill prerequisites. It is specified in detail in the <a href="./CPAN::Meta::Spec.html#Version-Ranges">&quot;Version Ranges&quot;</a> section.</p>

<h1 id="STRUCTURE"><a class="permalink" href="./CPAN::Meta::Spec.html#STRUCTURE">#</a>STRUCTURE</h1>

<p>The metadata structure is a data element of type Map. This section describes valid keys within the Map.</p>

<p>Any keys not described in this specification document (whether top-level or within compound data structures described herein) are considered <i>custom keys</i> and <b>must</b> begin with an &quot;x&quot; or &quot;X&quot; and be followed by an underscore; i.e. they must match the pattern: <code>qr{\Ax_}i</code>. If a custom key refers to a compound data structure, subkeys within it do not need an &quot;x_&quot; or &quot;X_&quot; prefix.</p>

<p>Consumers of metadata may ignore any or all custom keys. All other keys not described herein are invalid and should be ignored by consumers. Producers must not generate or output invalid keys.</p>

<p>For each key, an example is provided followed by a description. The description begins with the version of spec in which the key was added or in which the definition was modified, whether the key is <i>required</i> or <i>optional</i> and the data type of the corresponding data element. These items are in parentheses, brackets and braces, respectively.</p>

<p>If a data type is a Map or Map subtype, valid subkeys will be described as well.</p>

<p>Some fields are marked <i>Deprecated</i>. These are shown for historical context and must not be produced in or consumed from any metadata structure of version 2 or higher.</p>

<h2 id="REQUIRED-FIELDS"><a class="permalink" href="./CPAN::Meta::Spec.html#REQUIRED-FIELDS">#</a><a id="REQUIRED"></a>REQUIRED FIELDS</h2>

<h3 id="abstract"><a class="permalink" href="./CPAN::Meta::Spec.html#abstract">#</a>abstract</h3>

<p>Example:</p>

<pre><code class="plaintext">abstract =&gt; &#39;Build and install Perl modules&#39;</code></pre>

<p>(Spec 1.2) [required] {String}</p>

<p>This is a short description of the purpose of the distribution.</p>

<h3 id="author"><a class="permalink" href="./CPAN::Meta::Spec.html#author">#</a>author</h3>

<p>Example:</p>

<pre><code>author =&gt; [ &#39;Ken Williams &lt;kwilliams@cpan.org&gt;&#39; ]</code></pre>

<p>(Spec 1.2) [required] {List of one or more Strings}</p>

<p>This List indicates the person(s) to contact concerning the distribution. The preferred form of the contact string is:</p>

<pre><code class="plaintext">contact-name &lt;email-address&gt;</code></pre>

<p>This field provides a general contact list independent of other structured fields provided within the <a href="./CPAN::Meta::Spec.html#resources">&quot;resources&quot;</a> field, such as <code>bugtracker</code>. The addressee(s) can be contacted for any purpose including but not limited to (security) problems with the distribution, questions about the distribution or bugs in the distribution.</p>

<p>A distribution&#39;s original author is usually the contact listed within this field. Co-maintainers, successor maintainers or mailing lists devoted to the distribution may also be listed in addition to or instead of the original author.</p>

<h3 id="dynamic_config"><a class="permalink" href="./CPAN::Meta::Spec.html#dynamic_config">#</a>dynamic_config</h3>

<p>Example:</p>

<pre><code class="plaintext">dynamic_config =&gt; 1</code></pre>

<p>(Spec 2) [required] {Boolean}</p>

<p>A boolean flag indicating whether a <i>Build.PL</i> or <i>Makefile.PL</i> (or similar) must be executed to determine prerequisites.</p>

<p>This field should be set to a true value if the distribution performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its configuration. This field should be set to a false value to indicate that prerequisites included in metadata may be considered final and valid for static analysis.</p>

<p>Note: when this field is true, post-configuration prerequisites are not guaranteed to bear any relation whatsoever to those stated in the metadata, and relying on them doing so is an error. See also <a href="./CPAN::Meta::Spec.html#Prerequisites-for-dynamically-configured-distributions">&quot;Prerequisites for dynamically configured distributions&quot;</a> in the implementors&#39; notes.</p>

<p>This field explicitly <b>does not</b> indicate whether installation may be safely performed without using a Makefile or Build file, as there may be special files to install or custom installation targets (e.g. for dual-life modules that exist on CPAN as well as in the Perl core). This field only defines whether or not prerequisites are exactly as given in the metadata.</p>

<h3 id="generated_by"><a class="permalink" href="./CPAN::Meta::Spec.html#generated_by">#</a>generated_by</h3>

<p>Example:</p>

<pre><code class="plaintext">generated_by =&gt; &#39;Module::Build version 0.36&#39;</code></pre>

<p>(Spec 1.0) [required] {String}</p>

<p>This field indicates the tool that was used to create this metadata. There are no defined semantics for this field, but it is traditional to use a string in the form &quot;Generating::Package version 1.23&quot; or the author&#39;s name, if the file was generated by hand.</p>

<h3 id="license"><a class="permalink" href="./CPAN::Meta::Spec.html#license">#</a>license</h3>

<p>Example:</p>

<pre><code class="plaintext">license =&gt; [ &#39;perl_5&#39; ]

license =&gt; [ &#39;apache_2_0&#39;, &#39;mozilla_1_0&#39; ]</code></pre>

<p>(Spec 2) [required] {List of one or more License Strings}</p>

<p>One or more licenses that apply to some or all of the files in the distribution. If multiple licenses are listed, the distribution documentation should be consulted to clarify the interpretation of multiple licenses.</p>

<p>The following list of license strings are valid:</p>

<pre><code class="plaintext">string          description
-------------   -----------------------------------------------
agpl_3          GNU Affero General Public License, Version 3
apache_1_1      Apache Software License, Version 1.1
apache_2_0      Apache License, Version 2.0
artistic_1      Artistic License, (Version 1)
artistic_2      Artistic License, Version 2.0
bsd             BSD License (three-clause)
freebsd         FreeBSD License (two-clause)
gfdl_1_2        GNU Free Documentation License, Version 1.2
gfdl_1_3        GNU Free Documentation License, Version 1.3
gpl_1           GNU General Public License, Version 1
gpl_2           GNU General Public License, Version 2
gpl_3           GNU General Public License, Version 3
lgpl_2_1        GNU Lesser General Public License, Version 2.1
lgpl_3_0        GNU Lesser General Public License, Version 3.0
mit             MIT (aka X11) License
mozilla_1_0     Mozilla Public License, Version 1.0
mozilla_1_1     Mozilla Public License, Version 1.1
openssl         OpenSSL License
perl_5          The Perl 5 License (Artistic 1 &amp; GPL 1 or later)
qpl_1_0         Q Public License, Version 1.0
ssleay          Original SSLeay License
sun             Sun Internet Standards Source License (SISSL)
zlib            zlib License</code></pre>

<p>The following license strings are also valid and indicate other licensing not described above:</p>

<pre><code class="plaintext">string          description
-------------   -----------------------------------------------
open_source     Other Open Source Initiative (OSI) approved license
restricted      Requires special permission from copyright holder
unrestricted    Not an OSI approved license, but not restricted
unknown         License not provided in metadata</code></pre>

<p>All other strings are invalid in the license field.</p>

<h3 id="meta-spec"><a class="permalink" href="./CPAN::Meta::Spec.html#meta-spec">#</a><a id="meta"></a>meta-spec</h3>

<p>Example:</p>

<pre><code>&#39;meta-spec&#39; =&gt; {
  version =&gt; &#39;2&#39;,
  url     =&gt; &#39;http://search.cpan.org/perldoc?CPAN::Meta::Spec&#39;,
}</code></pre>

<p>(Spec 1.2) [required] {Map}</p>

<p>This field indicates the version of the CPAN Meta Spec that should be used to interpret the metadata. Consumers must check this key as soon as possible and abort further metadata processing if the meta-spec version is not supported by the consumer.</p>

<p>The following keys are valid, but only <code>version</code> is required.</p>

<dl>

<dt id="version"><a class="permalink" href="./CPAN::Meta::Spec.html#version">#</a>version</dt>
<dd>

<p>This subkey gives the integer <i>Version</i> of the CPAN Meta Spec against which the document was generated.</p>

</dd>
<dt id="url"><a class="permalink" href="./CPAN::Meta::Spec.html#url">#</a>url</dt>
<dd>

<p>This is a <i>URL</i> of the metadata specification document corresponding to the given version. This is strictly for human-consumption and should not impact the interpretation of the document.</p>

<p>For the version 2 spec, either of these are recommended:</p>

<ul>

<li><p><code>https://metacpan.org/pod/CPAN::Meta::Spec</code></p>

</li>
<li><p><code>http://search.cpan.org/perldoc?CPAN::Meta::Spec</code></p>

</li>
</ul>

</dd>
</dl>

<h3 id="name"><a class="permalink" href="./CPAN::Meta::Spec.html#name">#</a>name</h3>

<p>Example:</p>

<pre><code class="plaintext">name =&gt; &#39;Module-Build&#39;</code></pre>

<p>(Spec 1.0) [required] {String}</p>

<p>This field is the name of the distribution. This is often created by taking the &quot;main package&quot; in the distribution and changing <code>::</code> to <code>-</code>, but the name may be completely unrelated to the packages within the distribution. For example, <a href="./LWP::UserAgent.html">LWP::UserAgent</a> is distributed as part of the distribution name &quot;libwww-perl&quot;.</p>

<h3 id="release_status"><a class="permalink" href="./CPAN::Meta::Spec.html#release_status">#</a>release_status</h3>

<p>Example:</p>

<pre><code class="plaintext">release_status =&gt; &#39;stable&#39;</code></pre>

<p>(Spec 2) [required] {String}</p>

<p>This field provides the release status of this distribution. If the <code>version</code> field contains an underscore character, then <code>release_status</code> <b>must not</b> be &quot;stable.&quot;</p>

<p>The <code>release_status</code> field <b>must</b> have one of the following values:</p>

<dl>

<dt id="stable"><a class="permalink" href="./CPAN::Meta::Spec.html#stable">#</a>stable</dt>
<dd>

<p>This indicates an ordinary, &quot;final&quot; release that should be indexed by PAUSE or other indexers.</p>

</dd>
<dt id="testing"><a class="permalink" href="./CPAN::Meta::Spec.html#testing">#</a>testing</dt>
<dd>

<p>This indicates a &quot;beta&quot; release that is substantially complete, but has an elevated risk of bugs and requires additional testing. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user. This release status may also be used for &quot;release candidate&quot; versions of a distribution.</p>

</dd>
<dt id="unstable"><a class="permalink" href="./CPAN::Meta::Spec.html#unstable">#</a>unstable</dt>
<dd>

<p>This indicates an &quot;alpha&quot; release that is under active development, but has been released for early feedback or testing and may be missing features or may have serious bugs. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user.</p>

</dd>
</dl>

<p>Consumers <b>may</b> use this field to determine how to index the distribution for CPAN or other repositories in addition to or in replacement of heuristics based on version number or file name.</p>

<h3 id="version1"><a class="permalink" href="./CPAN::Meta::Spec.html#version1">#</a>version</h3>

<p>Example:</p>

<pre><code class="plaintext">version =&gt; &#39;0.36&#39;</code></pre>

<p>(Spec 1.0) [required] {Version}</p>

<p>This field gives the version of the distribution to which the metadata structure refers.</p>

<h2 id="OPTIONAL-FIELDS"><a class="permalink" href="./CPAN::Meta::Spec.html#OPTIONAL-FIELDS">#</a><a id="OPTIONAL"></a>OPTIONAL FIELDS</h2>

<h3 id="description"><a class="permalink" href="./CPAN::Meta::Spec.html#description">#</a>description</h3>

<p>Example:</p>

<pre><code class="plaintext">description =&gt;  &quot;Module::Build is a system for &quot;
  . &quot;building, testing, and installing Perl modules. &quot;
  . &quot;It is meant to ... blah blah blah ...&quot;,</code></pre>

<p>(Spec 2) [optional] {String}</p>

<p>A longer, more complete description of the purpose or intended use of the distribution than the one provided by the <code>abstract</code> key.</p>

<h3 id="keywords"><a class="permalink" href="./CPAN::Meta::Spec.html#keywords">#</a>keywords</h3>

<p>Example:</p>

<pre><code class="plaintext">keywords =&gt; [ qw/ toolchain cpan dual-life / ]</code></pre>

<p>(Spec 1.1) [optional] {List of zero or more Strings}</p>

<p>A List of keywords that describe this distribution. Keywords <b>must not</b> include whitespace.</p>

<h3 id="no_index"><a class="permalink" href="./CPAN::Meta::Spec.html#no_index">#</a>no_index</h3>

<p>Example:</p>

<pre><code>no_index =&gt; {
  file      =&gt; [ &#39;My/Module.pm&#39; ],
  directory =&gt; [ &#39;My/Private&#39; ],
  package   =&gt; [ &#39;My::Module::Secret&#39; ],
  namespace =&gt; [ &#39;My::Module::Sample&#39; ],
}</code></pre>

<p>(Spec 1.2) [optional] {Map}</p>

<p>This Map describes any files, directories, packages, and namespaces that are private to the packaging or implementation of the distribution and should be ignored by indexing or search tools. Note that this is a list of exclusions, and the spec does not define what to <i>include</i> - see <a href="./CPAN::Meta::Spec.html#Indexing-distributions-a-la-PAUSE">&quot;Indexing distributions a la PAUSE&quot;</a> in the implementors notes for more information.</p>

<p>Valid subkeys are as follows:</p>

<dl>

<dt id="file"><a class="permalink" href="./CPAN::Meta::Spec.html#file">#</a>file</dt>
<dd>

<p>A <i>List</i> of relative paths to files. Paths <b>must be</b> specified with unix conventions.</p>

</dd>
<dt id="directory"><a class="permalink" href="./CPAN::Meta::Spec.html#directory">#</a>directory</dt>
<dd>

<p>A <i>List</i> of relative paths to directories. Paths <b>must be</b> specified with unix conventions.</p>

<p>[ Note: previous editions of the spec had <code>dir</code> instead of <code>directory</code> ]</p>

</dd>
<dt id="package1"><a class="permalink" href="./CPAN::Meta::Spec.html#package1">#</a>package</dt>
<dd>

<p>A <i>List</i> of package names.</p>

</dd>
<dt id="namespace"><a class="permalink" href="./CPAN::Meta::Spec.html#namespace">#</a>namespace</dt>
<dd>

<p>A <i>List</i> of package namespaces, where anything below the namespace must be ignored, but <i>not</i> the namespace itself.</p>

<p>In the example above for <code>no_index</code>, <code>My::Module::Sample::Foo</code> would be ignored, but <code>My::Module::Sample</code> would not.</p>

</dd>
</dl>

<h3 id="optional_features"><a class="permalink" href="./CPAN::Meta::Spec.html#optional_features">#</a>optional_features</h3>

<p>Example:</p>

<pre><code>optional_features =&gt; {
  sqlite =&gt; {
    description =&gt; &#39;Provides SQLite support&#39;,
    prereqs =&gt; {
      runtime =&gt; {
        requires =&gt; {
          &#39;DBD::SQLite&#39; =&gt; &#39;1.25&#39;
        }
      }
    }
  }
}</code></pre>

<p>(Spec 2) [optional] {Map}</p>

<p>This Map describes optional features with incremental prerequisites. Each key of the <code>optional_features</code> Map is a String used to identify the feature and each value is a Map with additional information about the feature. Valid subkeys include:</p>

<dl>

<dt id="description1"><a class="permalink" href="./CPAN::Meta::Spec.html#description1">#</a>description</dt>
<dd>

<p>This is a String describing the feature. Every optional feature should provide a description</p>

</dd>
<dt id="prereqs"><a class="permalink" href="./CPAN::Meta::Spec.html#prereqs">#</a>prereqs</dt>
<dd>

<p>This entry is required and has the same structure as that of the <code><a href="./CPAN::Meta::Spec.html#prereqs">&quot;prereqs&quot;</a></code> key. It provides a list of package requirements that must be satisfied for the feature to be supported or enabled.</p>

<p>There is one crucial restriction: the prereqs of an optional feature <b>must not</b> include <code>configure</code> phase prereqs.</p>

</dd>
</dl>

<p>Consumers <b>must not</b> include optional features as prerequisites without explicit instruction from users (whether via interactive prompting, a function parameter or a configuration value, etc. ).</p>

<p>If an optional feature is used by a consumer to add additional prerequisites, the consumer should merge the optional feature prerequisites into those given by the <code>prereqs</code> key using the same semantics. See <a href="./CPAN::Meta::Spec.html#Merging-and-Resolving-Prerequisites">&quot;Merging and Resolving Prerequisites&quot;</a> for details on merging prerequisites.</p>

<p><i>Suggestion for disuse:</i> Because there is currently no way for a distribution to specify a dependency on an optional feature of another dependency, the use of <code>optional_feature</code> is discouraged. Instead, create a separate, installable distribution that ensures the desired feature is available. For example, if <code>Foo::Bar</code> has a <code>Baz</code> feature, release a separate <code>Foo-Bar-Baz</code> distribution that satisfies requirements for the feature.</p>

<h3 id="prereqs1"><a class="permalink" href="./CPAN::Meta::Spec.html#prereqs1">#</a>prereqs</h3>

<p>Example:</p>

<pre><code>prereqs =&gt; {
  runtime =&gt; {
    requires =&gt; {
      &#39;perl&#39;          =&gt; &#39;5.006&#39;,
      &#39;File::Spec&#39;    =&gt; &#39;0.86&#39;,
      &#39;JSON&#39;          =&gt; &#39;2.16&#39;,
    },
    recommends =&gt; {
      &#39;JSON::XS&#39;      =&gt; &#39;2.26&#39;,
    },
    suggests =&gt; {
      &#39;Archive::Tar&#39;  =&gt; &#39;0&#39;,
    },
  },
  build =&gt; {
    requires =&gt; {
      &#39;Alien::SDL&#39;    =&gt; &#39;1.00&#39;,
    },
  },
  test =&gt; {
    recommends =&gt; {
      &#39;Test::Deep&#39;    =&gt; &#39;0.10&#39;,
    },
  }
}</code></pre>

<p>(Spec 2) [optional] {Map}</p>

<p>This is a Map that describes all the prerequisites of the distribution. The keys are phases of activity, such as <code>configure</code>, <code>build</code>, <code>test</code> or <code>runtime</code>. Values are Maps in which the keys name the type of prerequisite relationship such as <code>requires</code>, <code>recommends</code>, or <code>suggests</code> and the value provides a set of prerequisite relations. The set of relations <b>must</b> be specified as a Map of package names to version ranges.</p>

<p>The full definition for this field is given in the <a href="./CPAN::Meta::Spec.html#Prereq-Spec">&quot;Prereq Spec&quot;</a> section.</p>

<h3 id="provides"><a class="permalink" href="./CPAN::Meta::Spec.html#provides">#</a>provides</h3>

<p>Example:</p>

<pre><code>provides =&gt; {
  &#39;Foo::Bar&#39; =&gt; {
    file    =&gt; &#39;lib/Foo/Bar.pm&#39;,
    version =&gt; &#39;0.27_02&#39;,
  },
  &#39;Foo::Bar::Blah&#39; =&gt; {
    file    =&gt; &#39;lib/Foo/Bar/Blah.pm&#39;,
  },
  &#39;Foo::Bar::Baz&#39; =&gt; {
    file    =&gt; &#39;lib/Foo/Bar/Baz.pm&#39;,
    version =&gt; &#39;0.3&#39;,
  },
}</code></pre>

<p>(Spec 1.2) [optional] {Map}</p>

<p>This describes all packages provided by this distribution. This information is used by distribution and automation mechanisms like PAUSE, CPAN, metacpan.org and search.cpan.org to build indexes saying in which distribution various packages can be found.</p>

<p>The keys of <code>provides</code> are package names that can be found within the distribution. If a package name key is provided, it must have a Map with the following valid subkeys:</p>

<dl>

<dt id="file1"><a class="permalink" href="./CPAN::Meta::Spec.html#file1">#</a>file</dt>
<dd>

<p>This field is required. It must contain a Unix-style relative file path from the root of the distribution directory to a file that contains or generates the package. It may be given as <code>META.yml</code> or <code>META.json</code> to claim a package for indexing without needing a <code>*.pm</code>.</p>

</dd>
<dt id="version2"><a class="permalink" href="./CPAN::Meta::Spec.html#version2">#</a>version</dt>
<dd>

<p>If it exists, this field must contains a <i>Version</i> String for the package. If the package does not have a <code>$VERSION</code>, this field must be omitted.</p>

</dd>
</dl>

<h3 id="resources"><a class="permalink" href="./CPAN::Meta::Spec.html#resources">#</a>resources</h3>

<p>Example:</p>

<pre><code>resources =&gt; {
  license     =&gt; [ &#39;http://dev.perl.org/licenses/&#39; ],
  homepage    =&gt; &#39;http://sourceforge.net/projects/module-build&#39;,
  bugtracker  =&gt; {
    web    =&gt; &#39;http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta&#39;,
    mailto =&gt; &#39;meta-bugs@example.com&#39;,
  },
  repository  =&gt; {
    url  =&gt; &#39;git://github.com/dagolden/cpan-meta.git&#39;,
    web  =&gt; &#39;http://github.com/dagolden/cpan-meta&#39;,
    type =&gt; &#39;git&#39;,
  },
  x_twitter   =&gt; &#39;http://twitter.com/cpan_linked/&#39;,
}</code></pre>

<p>(Spec 2) [optional] {Map}</p>

<p>This field describes resources related to this distribution.</p>

<p>Valid subkeys include:</p>

<dl>

<dt id="homepage"><a class="permalink" href="./CPAN::Meta::Spec.html#homepage">#</a>homepage</dt>
<dd>

<p>The official home of this project on the web.</p>

</dd>
<dt id="license1"><a class="permalink" href="./CPAN::Meta::Spec.html#license1">#</a>license</dt>
<dd>

<p>A List of <i>URL</i>&#39;s that relate to this distribution&#39;s license. As with the top-level <code>license</code> field, distribution documentation should be consulted to clarify the interpretation of multiple licenses provided here.</p>

</dd>
<dt id="bugtracker"><a class="permalink" href="./CPAN::Meta::Spec.html#bugtracker">#</a>bugtracker</dt>
<dd>

<p>This entry describes the bug tracking system for this distribution. It is a Map with the following valid keys:</p>

<pre><code class="plaintext">web    - a URL pointing to a web front-end for the bug tracker
mailto - an email address to which bugs can be sent</code></pre>

</dd>
<dt id="repository"><a class="permalink" href="./CPAN::Meta::Spec.html#repository">#</a>repository</dt>
<dd>

<p>This entry describes the source control repository for this distribution. It is a Map with the following valid keys:</p>

<pre><code class="plaintext">url  - a URL pointing to the repository itself
web  - a URL pointing to a web front-end for the repository
type - a lowercase string indicating the VCS used</code></pre>

<p>Because a url like <code>http://myrepo.example.com/</code> is ambiguous as to type, producers should provide a <code>type</code> whenever a <code>url</code> key is given. The <code>type</code> field should be the name of the most common program used to work with the repository, e.g. <code>git</code>, <code>svn</code>, <code>cvs</code>, <code>darcs</code>, <code>bzr</code> or <code>hg</code>.</p>

</dd>
</dl>

<h2 id="DEPRECATED-FIELDS"><a class="permalink" href="./CPAN::Meta::Spec.html#DEPRECATED-FIELDS">#</a><a id="DEPRECATED"></a>DEPRECATED FIELDS</h2>

<h3 id="build_requires"><a class="permalink" href="./CPAN::Meta::Spec.html#build_requires">#</a>build_requires</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>Replaced by <code>prereqs</code></p>

<h3 id="configure_requires"><a class="permalink" href="./CPAN::Meta::Spec.html#configure_requires">#</a>configure_requires</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>Replaced by <code>prereqs</code></p>

<h3 id="conflicts"><a class="permalink" href="./CPAN::Meta::Spec.html#conflicts">#</a>conflicts</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>Replaced by <code>prereqs</code></p>

<h3 id="distribution_type"><a class="permalink" href="./CPAN::Meta::Spec.html#distribution_type">#</a>distribution_type</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>This field indicated &#39;module&#39; or &#39;script&#39; but was considered meaningless, since many distributions are hybrids of several kinds of things.</p>

<h3 id="license_uri"><a class="permalink" href="./CPAN::Meta::Spec.html#license_uri">#</a>license_uri</h3>

<p><i>(Deprecated in Spec 1.2)</i> [optional] {URL}</p>

<p>Replaced by <code>license</code> in <code>resources</code></p>

<h3 id="private"><a class="permalink" href="./CPAN::Meta::Spec.html#private">#</a>private</h3>

<p><i>(Deprecated in Spec 1.2)</i> [optional] {Map}</p>

<p>This field has been renamed to <a href="./CPAN::Meta::Spec.html#no_index">&quot;no_index&quot;</a>.</p>

<h3 id="recommends"><a class="permalink" href="./CPAN::Meta::Spec.html#recommends">#</a>recommends</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>Replaced by <code>prereqs</code></p>

<h3 id="requires"><a class="permalink" href="./CPAN::Meta::Spec.html#requires">#</a>requires</h3>

<p><i>(Deprecated in Spec 2)</i> [optional] {String}</p>

<p>Replaced by <code>prereqs</code></p>

<h1 id="VERSION-NUMBERS"><a class="permalink" href="./CPAN::Meta::Spec.html#VERSION-NUMBERS">#</a><a id="VERSION1"></a>VERSION NUMBERS</h1>

<h2 id="Version-Formats"><a class="permalink" href="./CPAN::Meta::Spec.html#Version-Formats">#</a><a id="Version2"></a>Version Formats</h2>

<p>This section defines the Version type, used by several fields in the CPAN Meta Spec.</p>

<p>Version numbers must be treated as strings, not numbers. For example, <code>1.200</code> <b>must not</b> be serialized as <code>1.2</code>. Version comparison should be delegated to the Perl <a href="version.html">version</a> module, version 0.80 or newer.</p>

<p>Unless otherwise specified, version numbers <b>must</b> appear in one of two formats:</p>

<dl>

<dt id="Decimal-versions"><a class="permalink" href="./CPAN::Meta::Spec.html#Decimal-versions">#</a><a id="Decimal"></a>Decimal versions</dt>
<dd>

<p>Decimal versions are regular &quot;decimal numbers&quot;, with some limitations. They <b>must</b> be non-negative and <b>must</b> begin and end with a digit. A single underscore <b>may</b> be included, but <b>must</b> be between two digits. They <b>must not</b> use exponential notation (&quot;1.23e-2&quot;).</p>

<pre><code class="plaintext">version =&gt; &#39;1.234&#39;       # OK
version =&gt; &#39;1.23_04&#39;     # OK

version =&gt; &#39;1.23_04_05&#39;  # Illegal
version =&gt; &#39;1.&#39;          # Illegal
version =&gt; &#39;.1&#39;          # Illegal</code></pre>

</dd>
<dt id="Dotted-integer-versions"><a class="permalink" href="./CPAN::Meta::Spec.html#Dotted-integer-versions">#</a><a id="Dotted"></a>Dotted-integer versions</dt>
<dd>

<p>Dotted-integer (also known as dotted-decimal) versions consist of positive integers separated by full stop characters (i.e. &quot;dots&quot;, &quot;periods&quot; or &quot;decimal points&quot;). This are equivalent in format to Perl &quot;v-strings&quot;, with some additional restrictions on form. They must be given in &quot;normal&quot; form, which has a leading &quot;v&quot; character and at least three integer components. To retain a one-to-one mapping with decimal versions, all components after the first <b>should</b> be restricted to the range 0 to 999. The final component <b>may</b> be separated by an underscore character instead of a period.</p>

<pre><code class="plaintext">version =&gt; &#39;v1.2.3&#39;      # OK
version =&gt; &#39;v1.2_3&#39;      # OK
version =&gt; &#39;v1.2.3.4&#39;    # OK
version =&gt; &#39;v1.2.3_4&#39;    # OK
version =&gt; &#39;v2009.10.31&#39; # OK

version =&gt; &#39;v1.2&#39;          # Illegal
version =&gt; &#39;1.2.3&#39;         # Illegal
version =&gt; &#39;v1.2_3_4&#39;      # Illegal
version =&gt; &#39;v1.2009.10.31&#39; # Not recommended</code></pre>

</dd>
</dl>

<h2 id="Version-Ranges"><a class="permalink" href="./CPAN::Meta::Spec.html#Version-Ranges">#</a><a id="Version3"></a>Version Ranges</h2>

<p>Some fields (prereq, optional_features) indicate the particular version(s) of some other module that may be required as a prerequisite. This section details the Version Range type used to provide this information.</p>

<p>The simplest format for a Version Range is just the version number itself, e.g. <code>2.4</code>. This means that <b>at least</b> version 2.4 must be present. To indicate that <b>any</b> version of a prerequisite is okay, even if the prerequisite doesn&#39;t define a version at all, use the version <code>0</code>.</p>

<p>Alternatively, a version range <b>may</b> use the operators &lt; (less than), &lt;= (less than or equal), &gt; (greater than), &gt;= (greater than or equal), == (equal), and != (not equal). For example, the specification <code>&lt; 2.0</code> means that any version of the prerequisite less than 2.0 is suitable.</p>

<p>For more complicated situations, version specifications <b>may</b> be AND-ed together using commas. The specification <code>&gt;= 1.2, != 1.5, &lt; 2.0</code> indicates a version that must be <b>at least</b> 1.2, <b>less than</b> 2.0, and <b>not equal to</b> 1.5.</p>

<h1 id="PREREQUISITES"><a class="permalink" href="./CPAN::Meta::Spec.html#PREREQUISITES">#</a>PREREQUISITES</h1>

<h2 id="Prereq-Spec"><a class="permalink" href="./CPAN::Meta::Spec.html#Prereq-Spec">#</a><a id="Prereq"></a>Prereq Spec</h2>

<p>The <code>prereqs</code> key in the top-level metadata and within <code>optional_features</code> define the relationship between a distribution and other packages. The prereq spec structure is a hierarchical data structure which divides prerequisites into <i>Phases</i> of activity in the installation process and <i>Relationships</i> that indicate how prerequisites should be resolved.</p>

<p>For example, to specify that <code>Data::Dumper</code> is <code>required</code> during the <code>test</code> phase, this entry would appear in the distribution metadata:</p>

<pre><code>prereqs =&gt; {
  test =&gt; {
    requires =&gt; {
      &#39;Data::Dumper&#39; =&gt; &#39;2.00&#39;
    }
  }
}</code></pre>

<h3 id="Phases"><a class="permalink" href="./CPAN::Meta::Spec.html#Phases">#</a>Phases</h3>

<p>Requirements for regular use must be listed in the <code>runtime</code> phase. Other requirements should be listed in the earliest stage in which they are required and consumers must accumulate and satisfy requirements across phases before executing the activity. For example, <code>build</code> requirements must also be available during the <code>test</code> phase.</p>

<pre><code class="plaintext">before action       requirements that must be met
----------------    --------------------------------
perl Build.PL       configure
perl Makefile.PL

make                configure, runtime, build
Build

make test           configure, runtime, build, test
Build test</code></pre>

<p>Consumers that install the distribution must ensure that <i>runtime</i> requirements are also installed and may install dependencies from other phases.</p>

<pre><code class="plaintext">after action        requirements that must be met
----------------    --------------------------------
make install        runtime
Build install</code></pre>

<dl>

<dt id="configure"><a class="permalink" href="./CPAN::Meta::Spec.html#configure">#</a>configure</dt>
<dd>

<p>The configure phase occurs before any dynamic configuration has been attempted. Libraries required by the configure phase <b>must</b> be available for use before the distribution building tool has been executed.</p>

</dd>
<dt id="build"><a class="permalink" href="./CPAN::Meta::Spec.html#build">#</a>build</dt>
<dd>

<p>The build phase is when the distribution&#39;s source code is compiled (if necessary) and otherwise made ready for installation.</p>

</dd>
<dt id="test"><a class="permalink" href="./CPAN::Meta::Spec.html#test">#</a>test</dt>
<dd>

<p>The test phase is when the distribution&#39;s automated test suite is run. Any library that is needed only for testing and not for subsequent use should be listed here.</p>

</dd>
<dt id="runtime"><a class="permalink" href="./CPAN::Meta::Spec.html#runtime">#</a>runtime</dt>
<dd>

<p>The runtime phase refers not only to when the distribution&#39;s contents are installed, but also to its continued use. Any library that is a prerequisite for regular use of this distribution should be indicated here.</p>

</dd>
<dt id="develop"><a class="permalink" href="./CPAN::Meta::Spec.html#develop">#</a>develop</dt>
<dd>

<p>The develop phase&#39;s prereqs are libraries needed to work on the distribution&#39;s source code as its author does. These tools might be needed to build a release tarball, to run author-only tests, or to perform other tasks related to developing new versions of the distribution.</p>

</dd>
</dl>

<h3 id="Relationships"><a class="permalink" href="./CPAN::Meta::Spec.html#Relationships">#</a>Relationships</h3>

<dl>

<dt id="requires1"><a class="permalink" href="./CPAN::Meta::Spec.html#requires1">#</a>requires</dt>
<dd>

<p>These dependencies <b>must</b> be installed for proper completion of the phase.</p>

</dd>
<dt id="recommends1"><a class="permalink" href="./CPAN::Meta::Spec.html#recommends1">#</a>recommends</dt>
<dd>

<p>Recommended dependencies are <i>strongly</i> encouraged and should be satisfied except in resource constrained environments.</p>

</dd>
<dt id="suggests"><a class="permalink" href="./CPAN::Meta::Spec.html#suggests">#</a>suggests</dt>
<dd>

<p>These dependencies are optional, but are suggested for enhanced operation of the described distribution.</p>

</dd>
<dt id="conflicts1"><a class="permalink" href="./CPAN::Meta::Spec.html#conflicts1">#</a>conflicts</dt>
<dd>

<p>These libraries cannot be installed when the phase is in operation. This is a very rare situation, and the <code>conflicts</code> relationship should be used with great caution, or not at all.</p>

</dd>
</dl>

<h2 id="Merging-and-Resolving-Prerequisites"><a class="permalink" href="./CPAN::Meta::Spec.html#Merging-and-Resolving-Prerequisites">#</a><a id="Merging"></a>Merging and Resolving Prerequisites</h2>

<p>Whenever metadata consumers merge prerequisites, either from different phases or from <code>optional_features</code>, they should merged in a way which preserves the intended semantics of the prerequisite structure. Generally, this means concatenating the version specifications using commas, as described in the <a href="./CPAN::Meta::Spec.html#Version-Ranges">&quot;Version Ranges&quot;</a> section.</p>

<p>Another subtle error that can occur in resolving prerequisites comes from the way that modules in prerequisites are indexed to distribution files on CPAN. When a module is deleted from a distribution, prerequisites calling for that module could indicate an older distribution should be installed, potentially overwriting files from a newer distribution.</p>

<p>For example, as of Oct 31, 2009, the CPAN index file contained these module-distribution mappings:</p>

<pre><code class="plaintext">Class::MOP                   0.94  D/DR/DROLSKY/Class-MOP-0.94.tar.gz
Class::MOP::Class            0.94  D/DR/DROLSKY/Class-MOP-0.94.tar.gz
Class::MOP::Class::Immutable 0.04  S/ST/STEVAN/Class-MOP-0.36.tar.gz</code></pre>

<p>Consider the case where &quot;Class::MOP&quot; 0.94 is installed. If a distribution specified &quot;Class::MOP::Class::Immutable&quot; as a prerequisite, it could result in Class-MOP-0.36.tar.gz being installed, overwriting any files from Class-MOP-0.94.tar.gz.</p>

<p>Consumers of metadata <b>should</b> test whether prerequisites would result in installed module files being &quot;downgraded&quot; to an older version and <b>may</b> warn users or ignore the prerequisite that would cause such a result.</p>

<h1 id="SERIALIZATION"><a class="permalink" href="./CPAN::Meta::Spec.html#SERIALIZATION">#</a>SERIALIZATION</h1>

<p>Distribution metadata should be serialized (as a hashref) as JSON-encoded data and packaged with distributions as the file <i>META.json</i>.</p>

<p>In the past, the distribution metadata structure had been packed with distributions as <i>META.yml</i>, a file in the YAML Tiny format (for which, see <a href="./YAML::Tiny.html">YAML::Tiny</a>). Tools that consume distribution metadata from disk should be capable of loading <i>META.yml</i>, but should prefer <i>META.json</i> if both are found.</p>

<h1 id="NOTES-FOR-IMPLEMENTORS"><a class="permalink" href="./CPAN::Meta::Spec.html#NOTES-FOR-IMPLEMENTORS">#</a><a id="NOTES"></a>NOTES FOR IMPLEMENTORS</h1>

<h2 id="Extracting-Version-Numbers-from-Perl-Modules"><a class="permalink" href="./CPAN::Meta::Spec.html#Extracting-Version-Numbers-from-Perl-Modules">#</a><a id="Extracting"></a>Extracting Version Numbers from Perl Modules</h2>

<p>To get the version number from a Perl module, consumers should use the <code>MM-&gt;parse_version($file)</code> method provided by <a href="./ExtUtils::MakeMaker.html">ExtUtils::MakeMaker</a> or <a href="./Module::Metadata.html">Module::Metadata</a>. For example, for the module given by <code>$mod</code>, the version may be retrieved in one of the following ways:</p>

<pre><code># via ExtUtils::MakeMaker
my $file = MM-&gt;_installed_file_for_module($mod);
my $version = MM-&gt;parse_version($file)</code></pre>

<p>The private <code>_installed_file_for_module</code> method may be replaced with other methods for locating a module in <code>@INC</code>.</p>

<pre><code># via Module::Metadata
my $info = Module::Metadata-&gt;new_from_module($mod);
my $version = $info-&gt;version;</code></pre>

<p>If only a filename is available, the following approach may be used:</p>

<pre><code># via Module::Build
my $info = Module::Metadata-&gt;new_from_file($file);
my $version = $info-&gt;version;</code></pre>

<h2 id="Comparing-Version-Numbers"><a class="permalink" href="./CPAN::Meta::Spec.html#Comparing-Version-Numbers">#</a><a id="Comparing"></a>Comparing Version Numbers</h2>

<p>The <a href="version.html">version</a> module provides the most reliable way to compare version numbers in all the various ways they might be provided or might exist within modules. Given two strings containing version numbers, <code>$v1</code> and <code>$v2</code>, they should be converted to <code>version</code> objects before using ordinary comparison operators. For example:</p>

<pre><code>use version;
if ( version-&gt;new($v1) &lt;=&gt; version-&gt;new($v2) ) {
  print &quot;Versions are not equal\n&quot;;
}</code></pre>

<p>If the only comparison needed is whether an installed module is of a sufficiently high version, a direct test may be done using the string form of <code>eval</code> and the <code>use</code> function. For example, for module <code>$mod</code> and version prerequisite <code>$prereq</code>:</p>

<pre><code>if ( eval &quot;use $mod $prereq (); 1&quot; ) {
  print &quot;Module $mod version is OK.\n&quot;;
}</code></pre>

<p>If the values of <code>$mod</code> and <code>$prereq</code> have not been scrubbed, however, this presents security implications.</p>

<h2 id="Prerequisites-for-dynamically-configured-distributions"><a class="permalink" href="./CPAN::Meta::Spec.html#Prerequisites-for-dynamically-configured-distributions">#</a><a id="Prerequisites"></a>Prerequisites for dynamically configured distributions</h2>

<p>When <code>dynamic_config</code> is true, it is an error to presume that the prerequisites given in distribution metadata will have any relationship whatsoever to the actual prerequisites of the distribution.</p>

<p>In practice, however, one can generally expect such prerequisites to be one of two things:</p>

<ul>

<li><p>The minimum prerequisites for the distribution, to which dynamic configuration will only add items</p>

</li>
<li><p>Whatever the distribution configured with on the releaser&#39;s machine at release time</p>

</li>
</ul>

<p>The second case often turns out to have identical results to the first case, albeit only by accident.</p>

<p>As such, consumers may use this data for informational analysis, but presenting it to the user as canonical or relying on it as such is invariably the height of folly.</p>

<h2 id="Indexing-distributions-a-la-PAUSE"><a class="permalink" href="./CPAN::Meta::Spec.html#Indexing-distributions-a-la-PAUSE">#</a><a id="Indexing"></a>Indexing distributions a la PAUSE</h2>

<p>While no_index tells you what must be ignored when indexing, this spec holds no opinion on how you should get your initial candidate list of things to possibly index. For &quot;normal&quot; distributions you might consider simply indexing the contents of lib/, but there are many fascinating oddities on CPAN and many dists from the days when it was normal to put the main .pm file in the root of the distribution archive - so PAUSE currently indexes all .pm and .PL files that are not either (a) specifically excluded by no_index (b) in <code>inc</code>, <code>xt</code>, or <code>t</code> directories, or common &#39;mistake&#39; directories such as <code>perl5</code>.</p>

<p>Or: If you&#39;re trying to be PAUSE-like, make sure you skip <code>inc</code>, <code>xt</code> and <code>t</code> as well as anything marked as no_index.</p>

<p>Also remember: If the META file contains a provides field, you shouldn&#39;t be indexing anything in the first place - just use that.</p>

<h1 id="SEE-ALSO"><a class="permalink" href="./CPAN::Meta::Spec.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<ul>

<li><p>CPAN, <a href="http://www.cpan.org/">http://www.cpan.org/</a></p>

</li>
<li><p>JSON, <a href="http://json.org/">http://json.org/</a></p>

</li>
<li><p>YAML, <a href="http://www.yaml.org/">http://www.yaml.org/</a></p>

</li>
<li><p><a href="CPAN.html">CPAN</a></p>

</li>
<li><p><a href="CPANPLUS.html">CPANPLUS</a></p>

</li>
<li><p><a href="./ExtUtils::MakeMaker.html">ExtUtils::MakeMaker</a></p>

</li>
<li><p><a href="./Module::Build.html">Module::Build</a></p>

</li>
<li><p><a href="./Module::Install.html">Module::Install</a></p>

</li>
<li><p><a href="./CPAN::Meta::History::Meta_1_4.html">CPAN::Meta::History::Meta_1_4</a></p>

</li>
</ul>

<h1 id="HISTORY"><a class="permalink" href="./CPAN::Meta::Spec.html#HISTORY">#</a>HISTORY</h1>

<p>Ken Williams wrote the original CPAN Meta Spec (also known as the &quot;META.yml spec&quot;) in 2003 and maintained it through several revisions with input from various members of the community. In 2005, Randy Sims redrafted it from HTML to POD for the version 1.2 release. Ken continued to maintain the spec through version 1.4.</p>

<p>In late 2009, David Golden organized the version 2 proposal review process. David and Ricardo Signes drafted the final version 2 spec in April 2010 based on the version 1.4 spec and patches contributed during the proposal process.</p>

<h1 id="AUTHORS"><a class="permalink" href="./CPAN::Meta::Spec.html#AUTHORS">#</a>AUTHORS</h1>

<ul>

<li><p>David Golden &lt;dagolden@cpan.org&gt;</p>

</li>
<li><p>Ricardo Signes &lt;rjbs@cpan.org&gt;</p>

</li>
<li><p>Adam Kennedy &lt;adamk@cpan.org&gt;</p>

</li>
</ul>

<h1 id="COPYRIGHT-AND-LICENSE"><a class="permalink" href="./CPAN::Meta::Spec.html#COPYRIGHT-AND-LICENSE">#</a><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.</p>

<p>This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
